const dgraph = require("dgraph-js-http");


async function main () {
  const clientStub = new dgraph.DgraphClientStub("http://alpha.youling.io");
  const dgraphClient = new dgraph.DgraphClient(clientStub);

  const query = `{
   people(func: has(name)) {
    name
    age
  }
}`;
  const response = await dgraphClient.newTxn().query(query);
  console.log("Response: ", JSON.stringify(response.data));
}
main()